<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <span>4</span>
    </div>
</body>

<style>
    div{
        display: flex;
        width: 600px;
        height: 400px;
        background-color: rgba(112, 220, 203, 0.4);
        /*flex布局中，默认子元素不换行的，如果装不开就会缩小子元素的宽度，放到父元素里面*/
        flex-wrap: wrap;
    }
    div span{
        width: 150px;
        height: 100px;
        background-color: #eea068;
        margin: 10px;
    }
</style>
</html>